<{include file="app/header.tpl"}>

<{include file="app/js/mobiscroll_select.tpl"}>

<form class="user-tixian" onsubmit="return enter_submit_tixian();" method="POST">

    <p class="line"><label>姓名</label><input class="userName" placeholder="收款人姓名" required="" type="text" name="userName" value=""></p>
    <p class="line"><label>卡号</label><input class="number" placeholder="收款人储蓄帐号" required="" type="text" name="accountName" value=""></p>
    <p class="line fix">
        <label class="left">银行</label>
        <select class="bank" id="bank-list" name="bankName">
            <{foreach from=$bankList item="bank"}>
            <option value="<{$bank.value}>"><{$bank.value}></option>
            <{/foreach}>
        </select>
    </p>
    <p class="line"><label>金额</label><input class="money" required="" placeholder="可提取<{$moneyFen/100|number_format:2}>元" type="text" name="money" value="" money="<{$moneyFen}>"></p>
    <p class="error"></p>

    <input type="submit" value="确定" class="submit"  onclick="return submit_tixian();" >

</form>

<script>

function submit_tixian(){
    if (!$('.userName').val()) {
        $('.error').html('请输入收款人姓名');
        return false;
    }
    if (!$('.number').val()) {
        $('.error').html('请输入卡号/账户');
        return false;
    }

    if (!$('.bank').val()) {
        $('.error').html('请选择银行');
        return false;
    }

    if (!$('.money').val()) {
        $('.error').html('请输入金额(元)');
        return false;
    }

    if ($('.money').val()*100 > $('.money').attr('money'))
    {
        $('.error').html('可提取金额最多不超过<{$moneyFen/100|number_format:2}>元');
        return false;
    }

    return true;
    // 当申请失败的时候显示
    // $('.error').html('转出申请失败，请重新申请');

    //当申请成功的时候显示
    // $('.error').html('转出申请成功，请等待');

}
function enter_submit_tixian(){
    submit_tixian();
}

document.body.style.backgroundColor = '#fff';

</script>

<{include file="app/footer.tpl"}>
